/**
 * ActivityResult.java
 */

package c4.application.transactions;

import java.util.Properties;

/**
 * The result of an Activity's execution.
 * -1 for failure
 * 0 for delayed success
 * 1 for immediate success 
 * 
 * @author David Strickland
 */
public class ActivityResult {
	
	int result;
	Properties props = new Properties();
	String errorMessage = "";
	
	/**
	 * Get the result
	 * @return int	The result.
	 */
	public int getResult() {
		return result;
	}
	
	/**
	 * Set the result.
	 * @param result	The result to set this to
	 */
	public void setResult(int result) {
		this.result = result;
	}
	
	public boolean hasProperties() {
		return (props.size() > 0);
	}
	
	public void addProperty(String key, String value) {
		props.setProperty(key, value);
	}
	
	public void addErrorMessage(String message) {
		errorMessage += message;
	}
	
	public String getErrorMessages() {
		return errorMessage;
	}
	
	public Properties getProperties() {
		return props;
	}
	
	public void addProperties(Properties properties) {
		props.putAll(properties);
	}
}
